#include <bits/stdc++.h>
using namespace std;
void jifenduihuan(int total,vector<int>& prices,vector<int> result)
{
    if(total == 0){
        for(auto i:result)
            cout<<i<<" ";
        return;
    }
    else{
        for(int i=0;i<prices.size();i++)
        {
            int temp = prices[i];
            if(total>=temp)
            {
                result.push_back(temp);
                jifenduihuan(total-temp,prices,result);
            }

        }
        result.clear();
    }
}
int main() {
    vector<int> price = {40,50,40};
    int total = 100;
    vector<int> result;
    jifenduihuan(total,price,result);
    return 0;
}